package com.aboo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

import java.util.Properties;

@Slf4j
@SpringBootApplication
public class ProjectDemoApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        log.info("通过jar包方式加载...");
        SpringApplication.run(ProjectDemoApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        log.info("通过war包方式加载...");
        Properties properties = new Properties();
        properties.put("spring.profiles.active", "dev");
        application.properties(properties);
        return application.sources(ProjectDemoApplication.class);
    }

}
